<template>
	<view>
		<unicloud-db v-slot:default="{data, loading, error, options}" collection="wolf-activity" :where="where"
			@load="loadData" orderby="sort">
			<view class="active">
				<view class="u-box"  v-for="(item,index) in data" :key='item._id' @click="navTo(item)">
					<image :src="item.icon" mode="aspectFill" class="u-img"></image>
					<view class="section">
						<view class="s-title">{{item.title}}</view>
						<!-- <view class="s-body">
							<view class="s-date">截止：<uni-dateformat :date="item.end_time"
									:threshold="[60000, 3600000]"  format="yyyy/MM/dd"></uni-dateformat></view> -->
							<view class="s-price">￥<text
									style="font-size: 14px;color: #ff0000;">{{item.price/100 || 0}}</text>
							</view>
						<!-- </view> -->
					</view>
				</view>
			</view>
		</unicloud-db>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				where:`status == 1`
			}
		},
		methods: {
			navTo(item){
				let url = `/pages/grid/detail?id=${item._id}&title=${item.title}`
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style scoped>
	view {
		box-sizing: border-box;
	}
	.active{
		width: 750rpx;
		padding: 10rpx;
		display: flex;
		flex-wrap: wrap;
	}
	.u-box {
		display: flex;
		width: 100%;
		flex-direction: column;
		width: 50%;
		padding: 2px;
		box-sizing: border-box;
		background-color: #f9f9f9;
		border-radius: 5px;
	}
	
	.u-img {
		width: 100%;
		max-height: 360rpx;
	}
	.section {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 10rpx;
	}
	
	.s-title {
		width: 100%;
		font-size: 14px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		font-weight: 700;
	}
	
	.s-body {
		display: flex;
		font-size: 12px;
		justify-content: space-between;
	}
	
	.s-price {
		margin-left: 10px;
		align-items: center;
	}
</style>
